package model

import (
	"github.com/danfwing/sd-project/pkg/base"
)

type User struct {
	base.Model `xorm:"extends"`
	Username   string   `xorm:"varchar(100) unique notnull comment('用户名')"`
	Password   string   `xorm:"varchar(255) notnull comment('密码')"`
	Email      string   `xorm:"varchar(100) unique comment('邮箱')"`
	Phone      string   `xorm:"varchar(20) comment('手机号')"`
	Nickname   string   `xorm:"varchar(50) comment('昵称')"`
	Avatar     string   `xorm:"varchar(255) comment('头像')"`
	Status     int      `xorm:"tinyint default 1 comment('状态 1:正常 0:禁用')"`
	Roles      []string `xorm:"json comment('角色列表')"`
}

func (u *User) TableName() string {
	return "users"
}
